set(SOURCES
    ConsoleProgressBar.cpp
    ConsoleProgressIndicator.cpp
    DeviceHostProxy.cpp
    disk.cpp
    Distribution.cpp
    Dmesg.cpp
    DnsResolver.cpp
    DnsTunnelingChannel.cpp
    filesystem.cpp
    GnsChannel.cpp
    GnsPortTrackerChannel.cpp
    GuestDeviceManager.cpp
    HandleConsoleProgressBar.cpp
    hcs.cpp
    helpers.cpp
    interop.cpp
    ExecutionContext.cpp
    socket.cpp
    hvsocket.cpp
    Localization.cpp
    lxssbusclient.cpp
    lxssclient.cpp
    LxssMessagePort.cpp
    LxssSecurity.cpp
    LxssServerPort.cpp
    NatNetworking.cpp
    Redirector.cpp
    registry.cpp
    relay.cpp
    RingBuffer.cpp
    string.cpp
    SubProcess.cpp
    svccomm.cpp
    svccommio.cpp
    WslClient.cpp
    WslCoreConfig.cpp
    WslCoreFilesystem.cpp
    WslCoreFirewallSupport.cpp
    WslCoreHostDnsInfo.cpp
    WslCoreNetworkEndpointSettings.cpp
    WslCoreNetworkingSupport.cpp
    WslInstall.cpp
    WslSecurity.cpp
    WslTelemetry.cpp
    VirtioNetworking.cpp
    wslutil.cpp
    notifications.cpp)

set(HEADERS
    ../../../generated/Localization.h
    ../../shared/inc/CommandLine.h
    ../../shared/inc/defs.h
    ../../shared/inc/lxfsshares.h
    ../../shared/inc/lxinitshared.h
    ../../shared/inc/SocketChannel.h
    ../../shared/inc/socketshared.h
    ../../shared/inc/hns_schema.h
    ../../shared/inc/JsonUtils.h
    ../../shared/inc/stringshared.h
    ../../shared/inc/retryshared.h
    ../../shared/inc/message.h
    ../../shared/inc/prettyprintshared.h
    ../inc/WslPluginApi.h
    ../inc/wslpolicies.h
    ../inc/lxssbusclient.h
    ../inc/lxssclient.h
    ../inc/LxssDynamicFunction.h
    ../inc/traceloggingconfig.h
    ../inc/wdk.h
    ../inc/wsl.h
    ../inc/wslconfig.h
    ../inc/wslhost.h
    ../inc/wslrelay.h
    ConsoleProgressBar.h
    ConsoleProgressIndicator.h
    DeviceHostProxy.h
    disk.hpp
    Distribution.h
    Dmesg.h
    DnsResolver.h
    DnsTunnelingChannel.h
    filesystem.hpp
    GnsChannel.h
    GnsPortTrackerChannel.h
    GuestDeviceManager.h
    HandleConsoleProgressBar.h
    hcs.hpp
    hcs_schema.h
    helpers.hpp
    interop.hpp
    ExecutionContext.h
    socket.hpp
    hvsocket.hpp
    INetworkingEngine.h
    LxssMessagePort.h
    LxssPort.h
    LxssSecurity.h
    LxssServerPort.h
    NatNetworking.h
    precomp.h
    Redirector.h
    registry.hpp
    relay.hpp
    RingBuffer.h
    string.hpp
    Stringify.h
    SubProcess.h
    svccomm.hpp
    svccommio.hpp
    WslClient.h
    WslCoreConfig.h
    WslCoreFilesystem.h
    WslCoreFirewallSupport.h
    WslCoreHostDnsInfo.h
    WslCoreMessageQueue.h
    WslCoreNetworkEndpointSettings.h
    WslCoreNetworkingSupport.h
    WslInstall.h
    WslSecurity.h
    WslTelemetry.h
    VirtioNetworking.h
    wslutil.h
    notifications.h)

add_library(common STATIC ${SOURCES} ${HEADERS})
add_dependencies(common wslserviceidl localization wslservicemc wslinstalleridl)

target_precompile_headers(common PRIVATE precomp.h)
set_target_properties(common PROPERTIES FOLDER windows)
target_include_directories(common PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/../service/mc/${TARGET_PLATFORM}/${CMAKE_BUILD_TYPE})
